Skip to main content
Minh Nong
💬
0 discussions

[API] integrate-service

fpt.js

Push Brandname OTP

  • Route: /push-brandname-otp
  • Method: POST
  • Body: session_id, brand, phone, message
  • Related API:
    • client: POST /push-brandname-otp
  • Return Format:
    • Success: 200 res.json(resp.data)
    • Failure: 400 { success: false, error: { message: error } }

hubspot.js

Hubspot API

  • Route: /me
  • Header: x-hapikey
  • Method: GET
  • Related API:
    • hubspot: GET /integrations/v1/me
  • Return Format:
    • Success: 200 res.json(response.data)
    • Failure: 400 { success: false, error: error.response.data }

Create Contact

  • Route: /contact
  • Method: POST
  • Header: x-hapikey, x-haccesstoken
  • Body: firstname, lastname, email, phone, company, website, address, city, state, zip
  • Related API:
    • hubspot: POST /contacts/v1/contact
  • Return Format:
    • Success: 200 { success: true, result: response.data })
    • Failure: 400 { success: false, error: error.response.data }

Search Contact

  • Route: /contacts/search
  • Method: GET
  • Header: x-hapikey, x-haccesstoken
  • Query: q
  • Related API:
    • hubspot: GET /contacts/v1/search/query
  • Return Format:
    • Success: 200 res.json(response.data)
    • Failure: 400 { success: false, error: error.response.data }

Create Engagement

  • Route: /engagement
  • Header: x-hapikey, x-haccesstoken
  • Method: POST
  • Body: req.body
  • Related API:
    • hubspot: POST /engagements/v1/engagements
  • Return Format:
    • Success: 200 { success: true, result: response.data }
    • Failure: 400 { success: false, error: error.response.data }

Get Engagement

  • Route: /engagement/:id
  • Header: x-hapikey, x-haccesstoken
  • Method: GET
  • Related API:
    • hubspot: GET /engagements/v1/engagements/:id
  • Return Format:
    • Success: 200 { success: true, result: response.data }
    • Failure: 400 { success: false, error: error.response.data }

Update Engagement

  • Route: /engagement/:id
  • Header: x-hapikey, x-haccesstoken
  • Method: PUT
  • Related API:
    • hubspot: PATCH /engagements/v1/engagements/:id
  • Return Format:
    • Success: 200 { success: true, result: response.data }
    • Failure: 400 { success: false, error: error.response.data }

Delete Engagement

  • Route: /engagement/:id
  • Header: x-hapikey, x-haccesstoken
  • Method: DELETE
  • Related API:
    • hubspot: DELETE /engagements/v1/engagements/:id
  • Return Format:
    • Success: 200 { success: true, result: response.data }
    • Failure: 400 { success: false, error: error.response.data }

Get Engagements Associated with Contact

  • Route: /engagements/associated/contact
  • Header: x-hapikey, x-haccesstoken
  • Method: GET
  • Query: vid
  • Related API:
    • hubspot: GET /engagements/v1/engagements/associated/CONTACT/:vid
  • Return Format:
    • Success: 200 { success: true, result }
    • Failure: 400 { success: false, error: error.response.data }

Search Tickets

  • Route: /tickets/search
  • Header: x-hapikey, x-haccesstoken
  • Method: GET
  • Query: id
  • Related API:
    • hubspot: POST https://api.hubapi.com/crm/v3/objects/tickets/search
    • hubspot: POST https://api.hubapi.com/crm/v3/owners/${hubspot_owner_id}
  • Return Format:
    • Success: 200 { success: true, result }
    • Failure: 400 { success: false, error: error.response.data }

Create Ticket

  • Route: /ticket
  • Header: x-hapikey, x-haccesstoken
  • Method: POST
  • Body: subject, content, source_type, hubspot_owner_id, toObjectId
  • Related API:
    • hubspot: POST /crm-objects/v1/objects/tickets
    • hubspot: PUT /crm-associations/v1/associations
  • Return Format:
    • Success: 200 { success: true, result: response.data }
    • Failure: 400 { success: false, error: error.response.data }

Create Association

  • Route: /association
  • Header: x-hapikey, x-haccesstoken
  • Method: POST
  • Body: fromObjectId, toObjectId, definitionId
  • Related API:
    • hubspot: PUT /crm-associations/v1/associations
  • Return Format:
    • Success: 200 res.json({ success: true })
    • Failure: 400 { success: false, error: error.response.data }

Get Associations

  • Route: /associations
  • Header: x-hapikey, x-haccesstoken
  • Method: GET
  • Query: objectId, definitionId
  • Related API:
    • hubspot: GET /crm-associations/v1/associations/:objectId/HUBSPOT_DEFINED/:definitionId
  • Return Format:
    • Success: 200 { success: true, result: response.data }
    • Failure: 400 { success: false, error: error.response.data }

Get Recent Deals

  • Route: /deals/recent
  • Method: GET
  • Header: x-hapikey, x-haccesstoken
  • Query: objectId
  • Related API:
    • hubspot: GET /crm-associations/v1/associations/:objectId/HUBSPOT_DEFINED/4
    • hubspot: GET /deals/v1/deal/:offset
  • Return Format:
    • Success: 200 res.json({ success: true, result: { deal, count } })
    • Failure: 400 { success: false, error: error.response.data }

integrator.js

Post Endpoint

  • Route: /:endpoint_name
  • Method: POST
  • Params: endpoint_name
  • Body: req.body
  • Related API:
    • Client: GET /integration/endpoint/name/${endpoint_name}
    • Access: /integrators/?filter={"idCallcenter":"${body.idCallcenter}","idTemplate":"${api.idTemplate}"}
  • Return Format:
    • Success: 200 res.status(response.status).json(response.data)
    • Failure: 500 { success: false, error: { message: error.message } }

Post Endpoint in Template

  • Route: /:template_name/endpoint/:endpoint_name
  • Method: POST
  • Params: template_name, endpoint_name
  • Body: req.body
  • Query: versionSchema
  • Related API: [Not specified]
  • Return Format:
    • Success: 200 res.json(result)
    • Failure: 500 { success: false, error: { message: error.message } }

Check log integration

  • Route: /:idCallcenter/checklog
  • Method: GET
  • Params: idCallcenter
  • Query: versionSchema, data
  • Related API:
    • client: GET /integration/checklog/${idCallcenter}
  • Return Format:
    • Success: 200 res.json(result)
    • Failure: 500 { success: false, error: { message: error.message } }

Restore log integration

  • Route: /:idCallcenter/restorelog
  • Method: POST
  • Params: idCallcenter
  • Body: templateName
  • Query: versionSchema
  • Related API:
    • client: POST /integration/restorelog/${idCallcenter}
  • Return Format:
    • Success: 200 res.json(response.data)
    • Failure: 500 { success: false, error: { message: error.message } }

mio.js

Get Investor By Phone

  • Route: /get-investor-by-phone
  • Method: GET
  • Query: cell_phone
  • Headers: x-mio-clientid, x-mio-securesecret
  • Related API:
    • mio: GET /api-get-investor-by-phone
  • Return Format:
    • Success: 200 res.status(response.status).json(response.data)
    • Failure: 400 { success: false, error: { message: error } }

nexmo.js

Send SMS

  • Route: /sms
  • Method: GET
  • Query: phone, sms, apikey, apisecret, brand
  • Related API:
    • Vonage: vonage.message.sendSms
  • Return Format:
    • Success: 200 res.status(200).json(responseData.messages[0]['status'])
    • Failure: 400 res.json(responseData.messages[0]['status'])

Inbound SMS

  • Route: /inbound-sms
  • Method: GET
  • Query: text, msisdn, to, api-key, idCallcenter
  • Related API:
    • Access: GET /nexmos
    • Access: GET /callcenter/${idCallcenter}/phone
    • Access: POST /callcenter/${idCallcenter}/contact
    • Access: GET /callcenter/${idCallcenter}/contact/${idContact}/activities
    • Access: GET /user/search
    • Access: POST /callcenter/${idCallcenter}/contact/${idContact}/activity
  • Return Format:
    • Success: 200 res.status(200).json(response.data)
    • Failure: 500 { success: false, error: { message: error.message } }

nhanh.js

Search Customer

  • Route: /customer/search
  • Method: GET
  • Query: mobile
  • Headers: x-apiusername, x-secretkey
  • Related API:
    • nhanh: GET /api/customer/search
  • Return Format:
    • Success: 200 res.json(response.data)
    • Failure: 500 { success: false, error: { message: error.message } }

sapo.js

Get Customers

  • Route: /customers
  • Method: GET
  • Query: page, per_page, keyword, status
  • Headers: x-sapo-access-token, x-sapo-tenant
  • Related API:
    • Sapo: GET https://${tenant}.mysapogo.com/admin/customers.json
  • Return Format:
    • Success: 200 res.json(response.data)
    • Failure: 500 { success: false, error: { message: error.message } }

Add Note

  • Route: /customers/note
  • Method: POST
  • Body: customerId, accountId, content
  • Headers: x-sapo-access-token, x-sapo-tenant
  • Related API:
    • Sapo: POST https://${tenant}.mysapogo.com/admin/customers/${customerId}/notes.json
  • Return Format:
    • Success: 200 res.json(response.data)
    • Failure: 500 { success: false, error: { message: error.message } }

Get Accounts

  • Route: /accounts
  • Method: GET
  • Query: req.query
  • Headers: x-sapo-access-token, x-sapo-tenant
  • Related API:
    • Sapo: GET https://${tenant}.mysapogo.com/admin/accounts.json
  • Return Format:
    • Success: 200 res.json(response.data)
    • Failure: 500 { success: false, error: { message: error.message } }

Get Account

  • Route: /accounts/:id
  • Method: GET
  • Params: id
  • Headers: x-sapo-access-token, x-sapo-tenant
  • Related API:
    • Sapo: https://${tenant}.mysapogo.com/admin/accounts/${req.params.id}.json
  • Return Format:
    • Success: 200 res.json(response.data)
    • Failure: 500 { success: false, error: { message: error.message } }

Get Orders

  • Route: /orders
  • Method: GET
  • Query: req.query
  • Headers: x-sapo-access-token, x-sapo-tenant
  • Related API:
    • Sapo: GET https://${tenant}.mysapogo.com/admin/orders.json
  • Return Format:
    • Success: 200 res.json(response.data)
    • Failure: 500 { success: false, error: { message: error.message } }

trigger.js

Calllog

  • Route: /calllogd
  • Method: POST
  • Body: idCallcenter, data
  • Related API:
    • Access: GET /callcenter/${idCallcenter}/integrator
    • Access: GET /integration/endpoints/?filter=${JSON.stringify(filter)}
  • Return Format:
    • Success: 200 {success: true}
    • Failure: 500 { success: false, error: { message: error.message } }

vietguy.js

Send SMS

  • Route: /sms

  • Method: GET

  • Query: phone, sms

  • Related API:

  • client: GET /api/

  • Return Format:

  • Success: 200 res.json(response.data)

  • Failure: 500 { success: false, error: { message: error.message } }